<template>
  <div class="haveRight-container" v-if="props.layoutDirection == 'right'">
    <div class="container-column-main">
      <div class="container-page">
        <slot name="page"></slot>
      </div>
    </div>
    <div class="container-column-right">
      <div class="container-rightBox">
        <slot name="rightBox"></slot>
      </div>
    </div>
  </div>

  <div class="haveLeft-container" v-if="props.layoutDirection == 'left'">
    <div class="container-column-left">
      <div class="container-leftBox">
        <slot name="leftBox"></slot>
      </div>
    </div>
    <div class="container-column-main">
      <div class="container-page">
        <slot name="page"></slot>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
interface IProps {
  layoutDirection?: "right" | "left"
}

const props = withDefaults(defineProps<IProps>(), {
  layoutDirection: "right"
})
</script>

<style lang="less" scoped>
.haveRight-container {
  display: flex;
  // background-color: #ecf5ff;
  .container-column-main {
    display: flex;
    justify-content: flex-end;
    flex-grow: 1;
    flex-shrink: 1; // 默认值就是
    flex-basis: auto; // 默认值就是
    // width: 200px;
    // height: 1000px;
    // height: 100vh;

    .container-page {
      width: var(--container-page-width) !important;
    }
  }
  .container-column-right {
    display: flex;
    justify-content: flex-start;
    flex: 1 1 auto;
    // width: 100px;
    // height: 1000px;
    margin-left: 30px;

    .container-rightBox {
      width: var(--container-right-width) !important;
      //   background-color: aqua;
    }
  }
}
.haveLeft-container {
  display: flex;
  // background-color: #ecf5ff;
  .container-column-left {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 auto;
    // width: 100px;
    // height: 1000px;
    margin-right: 30px;

    .container-leftBox {
      width: var(--container-right-width) !important;
      //   background-color: aqua;
    }
  }
  .container-column-main {
    display: flex;
    justify-content: flex-start;
    flex-grow: 1;
    flex-shrink: 1; // 默认值就是
    flex-basis: auto; // 默认值就是
    // width: 200px;
    // height: 1000px;
    // height: 100vh;

    .container-page {
      width: var(--container-page-width) !important;
    }
  }
}
</style>
